import { getProClassListFn } from "./api/home";

import { useDispatch,useSelector } from "react-redux";
import { useEffect } from "react";

import { changeKindList } from "./store/modules/kind";

export default function Kind() {

    const dispatch = useDispatch()
    const kindList = useSelector(state=>state.kind.kindList)

    useEffect(()=>{
        getProClassListFn().then(res=>{
            dispatch(changeKindList(res.data.data))
            // console.log(res.data.data);
            // console.log(kindList);
        })
    },[])
    return <>
      <ul>
        {kindList && kindList.map(item =>{
            return <li key={item}>{item}</li>
        })}
      </ul>
    </>
}